package com.bls.productmall.controller;

import com.bls.productmall.entity.User;
import com.bls.productmall.service.UserService;
import com.bls.productmall.vo.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/api/user")
@Slf4j
@CrossOrigin //开放前端的跨域访问
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public R adminLogin(@RequestBody User user){
        log.info("管理员登录接口...");
        return userService.adminLogin(user);
    }

}
